package model

import (
	"time"
	"gorm.io/gorm"
)

// 枚举类型定义
type GroupStatusType string
const (
  GroupStatusTypeForbidden GroupStatusType = "forbidden"
GroupStatusTypeNormal GroupStatusType = "normal"
)


// Group 群组
type Group struct {
 Id int64 `json:"id" gorm:"primaryKey;autoIncrement;comment:群组自增id" ` // 群组自增id
 GroupId string `json:"group_id" gorm:"type:varchar(36);not null;unique;comment:群组uuid" ` // 群组uuid
 CreatorUid int64 `json:"creator_uid" gorm:"type:int;not null;comment:群组所属用户id" ` // 群组所属用户id
 GroupName string `json:"group_name" gorm:"type:varchar(48);not null;comment:群组名称" ` // 群组名称
 GroupAvatar string `json:"group_avatar" gorm:"type:varchar(120);not null;default:'default_assets/default_group_avatar.jpg';comment:群组头像" ` // 群组头像
 GroupIntroduce *string `json:"group_introduce" gorm:"type:text;comment:群组简介" ` // 群组简介
 GroupStatus GroupStatusType `json:"group_status" gorm:"type:enum('forbidden','normal');not null;default:'normal';comment:群状态" ` // 群状态
 CreateBy int64 `json:"create_by" gorm:"type:int;not null;comment:创建者id" ` // 创建者id
 UpdateBy int64 `json:"update_by" gorm:"type:int;not null;comment:修改者id" ` // 修改者id
 CreateTime time.Time `json:"create_time" gorm:"not null;autoCreateTime;comment:创建时间" ` // 创建时间
 UpdateTime time.Time `json:"update_time" gorm:"not null;autoUpdateTime;comment:更新时间" ` // 更新时间
 DeleteTime gorm.DeletedAt `json:"delete_time" gorm:"index;comment:删除时间" swaggerignore:"true"` // 删除时间
}

// TableName 指定表名
func (Group) TableName() string {
	return "group"
}
